#include "email.h"
#include <sstream>
#include <iostream>
/*
 *	Name: Joshua Zuber
 *	Date: 3/19/2014
 *  Course: CS 325; Spring 2014
 *	Description:	This file contains the implementation of the constructors and core functions of the email class.
 */
using namespace E;
using namespace System::Text;

Email::Email(){
	body = "";
	numberOfWords = 0;
	numOutliers = 0;
};

Email::Email(String^ body, int numberOfWords){
	this->body = body;
	this->numberOfWords = numberOfWords;
	numOutliers = 0;
};

void Email::insertIntoArray(String^ x){
	if(numOutliers < 15){
		outliers[numOutliers] = x;
		numOutliers++;
	} else{
		Console::WriteLine("There are too many outliers.  The maximum is 15.");
	}
};

String^ Email::printElementsInArray(){
	StringBuilder^ list = gcnew StringBuilder();
	for(int i=0; i<outliers->Length;i++)
	{
		list->Append(outliers[i]);
		list->AppendLine();
	}
	return list->ToString();
};

